﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Manageweb_ManageUser_ManageUser : System.Web.UI.Page
{
    MODEL.User MU = new MODEL.User();

    BLL.User BU = new BLL.User();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.Cookies["MasterID"] == null)
        {
            Response.Redirect("Default.aspx");
        }
    }


    #region 用户账户是否启用 [格式化]
    protected string FormatIsLock(object _IsLock)
    {
        bool LockState = Convert.ToBoolean(_IsLock);

        if (LockState)
        {
            return "已锁定";
        }
        else
        {
            return "已启用";
        }
    }
    #endregion


    #region 用户账户启用/锁定状态切换 [GridView] [Command]
    protected void Btn_IsLock_Command(object sender, CommandEventArgs e)
    {
        try
        {
            MU.User_ID = Convert.ToInt32(e.CommandArgument);

            BU.MarkIsLock(MU);

            GV_UserList.DataBind();
        }
        catch (Exception ex)
        {
            LB_ManageUser.Text = ex.Message;
        }
    }
    #endregion
}
